Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gnus handling of html based email

0 views
Skip to first unread message

Chuck Mattern

unread,
Aug 14, 2001, 12:00:03 AM8/14/01
to
I use gnus 5.8 as my mail reader with the nnmh backend. I am looking
for a way to have it render html based email as text with an embedded
url reference rhather that what it is doing for me now which is
displaying it with w3 immediately.

For instance if I hit <spc> to open my inbox from the Group summary
and the first message up is from one of html centric freinds I go into
a large pause while w3 loads, then my system goes about resolving,
contacting loading, etc. I've found references on using netscape
instead of w3 but what I'm really after is just having gnus display
the text, embed the urls and let me decide if I want to go out of the
web.

Any assistance appreciated.

Regards,
Chuck
--
-----------------------------------------------------------------------
|Chuck Mattern | "True strength lies in gentleness" |
|cmat...@mediaone.net | -Irish Proverb- |
-----------------------------------------------------------------------

Benjamin Rutt

unread,
Aug 14, 2001, 2:10:06 AM8/14/01
to
Chuck Mattern <cmat...@mediaone.net> writes:

> I use gnus 5.8 as my mail reader with the nnmh backend. I am looking
> for a way to have it render html based email as text with an embedded
> url reference rhather that what it is doing for me now which is
> displaying it with w3 immediately.

try this in ~/.gnus:

(setq mm-inline-override-types '("text/html"))

--
Benjamin

Jesper Petersen

unread,
Aug 14, 2001, 5:14:14 AM8/14/01
to

Chuck> I use gnus 5.8 as my mail reader with the nnmh backend. I am
Chuck> looking for a way to have it render html based email as text
Chuck> with an embedded url reference rhather that what it is doing
Chuck> for me now which is displaying it with w3 immediately.

I use the following that I've found on the net, see if it does what
you want:

;****************************************************************
;; Alternatives to rendering HTML-mails/articles by w3?
;; From: Mark Thomas <mth...@jprc.com>
;; I did this a few of months ago and I have been very happy with the
;; almost instantaneous display of html content.

(defun remassoc (elt list)
(let ((result '()))
(mapcar (lambda (e) (unless (and (consp e)
(equal elt (car e)))
(setq result (cons e result))))
list)
(nreverse result)))

(setq
;; prefer to show plain text over markup for multipart/alternative
mm-discouraged-alternatives (append mm-discouraged-alternatives
'("text/html"
"text/richtext"
))

;; use lynx -dump to view inline HTML
mm-inline-media-tests (cons '("text/html"
my:gnus-html2text
(lambda (handle)
(fboundp 'my:gnus-html2text)))
(remassoc "text/html"
mm-inline-media-tests))
)

;; function to call to handle text/html attachments
(defun my:gnus-html2text (handle)
(let (text)
(with-temp-buffer
(mm-insert-part handle)
(save-window-excursion
(my:html2text-region (point-min) (point-max))
(setq text (buffer-string))))
(mm-insert-inline handle text)))

(defun my:html2text-region (min max)
"Replace the HTML region from MIN to MAX with lynx --dump."
(interactive "r")
(let ( (file (concat (make-temp-name "/tmp/") ".html")) )
(unwind-protect
(progn
(write-region min max file)
(delete-region min max)
(insert (shell-command-to-string
(concat "/usr/bin/lynx "
"/usr/bin/lynx -dump "
(shell-quote-argument
(expand-file-name file))))))
(delete-file file))))
;****************************************************************

Jesper

--
Remove **Delete** from my email-address when replying by mail.

Chuck Mattern

unread,
Aug 14, 2001, 5:35:04 AM8/14/01
to
Benjamin Rutt <brutt...@bloomington.in.us> writes:

That did it! Many thanks. BTW is there a dividing line between what
should go in the .emacs and what should go in the .gnus files? I've
got most of my gnus setting in .emacs.

Kai Großjohann

unread,
Aug 14, 2001, 7:44:35 AM8/14/01
to
Chuck Mattern <cmat...@mediaone.net> writes:

> That did it! Many thanks. BTW is there a dividing line between what
> should go in the .emacs and what should go in the .gnus files? I've
> got most of my gnus setting in .emacs.

Not really. It's a matter of taste, mostly.

kai
--
~/.signature: No such file or directory

Karl Kleinpaste

unread,
Aug 14, 2001, 8:51:12 AM8/14/01
to
Chuck Mattern <cmat...@mediaone.net> writes:
> BTW is there a dividing line between what
> should go in the .emacs and what should go in the .gnus files?

The significant difference to consider is that .emacs is processed
once, when Emacs starts, whereas .gnus is started every time you start
Gnus. Thus, gaining the effects of hand-editing of .emacs requires a
new Emacs, but gaining the effects of hand-editing .gnus merely
requires restarting Gnus alone.

Other than that, it's personal preference and maybe religion.

0 new messages